package field_REGEX_Definitions.DebixFields;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import field_REGEX_Definitions.Field;
import fields.*;


public class Middle_Name implements Field{
	private Pattern middleName = Pattern.compile("[\\n\\s]*middle\\s*name[:\\n\\s]*(\\S*)",Pattern.CASE_INSENSITIVE);
	private String field;
	private String type;
	
	public boolean matches(String input) {
		Matcher matcher = middleName.matcher(input);
		boolean result = matcher.find();
		if (result) {
			field = "Middle Name";
		}
		return result;
	}
	
	public String getFieldName(){
		return field;
	}

	public Name execute() {
		return new Name(field,"Debix");
	}

	@Override
	public String getFieldType() {
		return type;
	}
}
